.class public Lcom/brixd/niceapp/model/CategoryModel;
.super Ljava/lang/Object;
.source "CategoryModel.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final serialVersionUID:J = -0x5cd200725b86ebbaL


# instance fields
.field public categoryAppModels:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/CategoryAppModel;",
            ">;"
        }
    .end annotation
.end field

.field public categoryName:Ljava/lang/String;

.field public cid:I

.field public iconUrl:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 10
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static parseCategoryModels(Lorg/json/JSONObject;)Ljava/util/ArrayList;
    .registers 8
    .param p0, "jsonObj"    # Lorg/json/JSONObject;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONObject;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CategoryModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 19
    const-string v5, "apps"

    invoke-virtual {p0, v5}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    .line 20
    .local v3, "jsonArray":Lorg/json/JSONArray;
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 21
    .local v4, "models":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/model/CategoryModel;>;"
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_c
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v5

    if-ge v1, v5, :cond_46

    .line 22
    invoke-virtual {v3, v1}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v2

    .line 23
    .local v2, "jo":Lorg/json/JSONObject;
    new-instance v0, Lcom/brixd/niceapp/model/CategoryModel;

    invoke-direct {v0}, Lcom/brixd/niceapp/model/CategoryModel;-><init>()V

    .line 24
    .local v0, "categoryModel":Lcom/brixd/niceapp/model/CategoryModel;
    const-string v5, "id"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v5

    iput v5, v0, Lcom/brixd/niceapp/model/CategoryModel;->cid:I

    .line 25
    const-string v5, "title"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v0, Lcom/brixd/niceapp/model/CategoryModel;->categoryName:Ljava/lang/String;

    .line 26
    const-string v5, "icon_url"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v0, Lcom/brixd/niceapp/model/CategoryModel;->iconUrl:Ljava/lang/String;

    .line 27
    const-string v5, "top_apps"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v5

    const/4 v6, 0x1

    invoke-static {v0, v5, v6}, Lcom/brixd/niceapp/model/CategoryAppModel;->parseCategoryAppModel(Lcom/brixd/niceapp/model/CategoryModel;Lorg/json/JSONArray;Z)Ljava/util/ArrayList;

    move-result-object v5

    iput-object v5, v0, Lcom/brixd/niceapp/model/CategoryModel;->categoryAppModels:Ljava/util/List;

    .line 29
    invoke-virtual {v4, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 21
    add-int/lit8 v1, v1, 0x1

    goto :goto_c

    .line 32
    .end local v0    # "categoryModel":Lcom/brixd/niceapp/model/CategoryModel;
    .end local v2    # "jo":Lorg/json/JSONObject;
    :cond_46
    return-object v4
.end method
